<#include "/common/new.html" /> <@layout>
<head>

</head>
<style>
   
    .my-head {
      margin-top: 10px;
      text-align: center;
    }

  </style>
<script>
	function edit() {
		var id = $("#id").attr("value")
		var url = "${ctx}/wxContent/edit?id=" + id;
		window.location.href = url;
	}
	function gk(obj) {
			  var id=$("#id").attr("value");
			  $("#gkzt").attr("value",obj);
		      var url = '${ctx}/wxContent/gk';
		      $('#myform').form('submit', {
		          url : url,
		          onSubmit : function() {
		          },
		          success : function(data) {
		              // 回填页面
		        	  var url ="${ctx}/wxContent?id="+id+"&from=user";
		        	  window.location.href=url;
		          }
		      });
	}
	function savetype(obj) {
		var url = '${ctx}/weixin/savetype/';
		$('#myform').form('submit', {
			url : url,
			onSubmit : function() {
			},
			success : function(data) {
				// 回填页面
				alert(data);
				WeixinJSBridge.invoke('closeWindow',{},function(res){
				});
			}
		});
	}
	function dels(obj) {
		var url = '${ctx}/wxContent/delete/';
		$('#myform').form('submit', {
			url : url,
			onSubmit : function() {
			},
			success : function(data) {
				// 回填页面
				alert(data);
				WeixinJSBridge.invoke('closeWindow',{},function(res){
				});
			}
		});
	}
</script>
<body >
<header class=" am-header  am-no-layout am-header-default am-topbar ">
  <div class="am-container">
    <h1 class=" am-topbar-brand" style="color: white;">
      超级朋友圈2.0
    </h1>
   <button class="am-topbar-btn am-topbar-toggle am-btn am-btn-sm am-btn-secondary am-show-sm-only am-collapsed"
     data-am-collapse="{target: '#collapse-head'}">菜单
            <span class="am-sr-only">导航切换</span>
             </button>

    <div class="am-topbar-collapse am-collapse" id="collapse-head" style="height: 20px;">
<#if (argu)??> <#if (argu)=="edit">
				
						<#if (gkzt)??> <#if (gkzt)=="1">  </#if>
						</#if> <#if (gkzt)??> <#if (gkzt)=="0"> 
						</#if> </#if> <#if (gkzt)??> <#if (gkzt)=="1"> 
						<button class="am-btn am-btn-success am-topbar-btn am-btn-sm"  title=" 本文处于公开状态，点击私密按钮取消公开"
						 onclick="gk('0');"> 
						<i class=" am-icon-lock"></i> 私密
						</button>&nbsp;&nbsp; </#if> <#if (gkzt)=="0"> <button title=" 本文处于私密状态，点击公开按钮分享给好友。"
							class="am-btn am-btn-danger am-topbar-btn am-btn-sm" onclick="gk('1');"> <i
							class=" am-icon-unlock"></i> 公开
						</button>&nbsp;&nbsp; </#if> </#if> <button
							class="am-btn am-btn-secondary am-topbar-btn am-btn-sm" onclick="edit();">编辑</button>
						&nbsp;&nbsp; <a href="#" class="am-btn am-btn-warning am-topbar-btn am-btn-sm"
							onclick="dels();">删除</a>
					
					</#if> </#if> <#if (argu)??> <#if (argu)=="view">
					<p class="alert alert-info">
						<button class="btn btn-primary btn-small" onclick="savetype();">选择此模板</button>
					</p>
					</#if> </#if>
    </div>
  </div>
</header>
   <#if (mblist)??> 
		 <#list mblist as m>
<div data-am-widget="slider" class="am-slider am-slider-a1" data-am-slider='{&quot;directionNav&quot;:false}'>
  <ul class="am-slides">
    <li>
      <img src="${ctx}${(m.picurl)!}">
    </li>
   
  </ul>
</div>
		 </#list>
		</#if>

<div class="am-u-sm-12 am-article ">
    <article class="blog-main">
      <h1 class="am-article-title my-head" >
        <#if (newlist)??>
         <#list newlist as m> ${(m.title)!} </#list> 
							</#if> 
							<#if (argu)??> <#if (argu)=="view"> ${(mbmc)!} 
							</#if> 
							</#if>
      </h1>
      <h4 class="am-article-meta my-head">
						<#if (argu)??> <#if (argu)!="view">  浏览 <#list
							newlist as m>${(m.yds)!}</#list>
							</#if> 
							</#if>
      </h4>

      <div class="am-g">
        <div class="am-u-sm-12"   >

    		<#if (newlist)??> 
				<#list newlist as m>
				<input type="hidden" name="id" id="id" value="${(m.id)!}">
				${(m.content)!}
				 </#list> 
				</#if> 
        </div>
      </div>
    </article>
    <hr class="am-article-divider blog-hr">
  </div>
    <hr class="am-article-divider blog-hr">



<footer class="am-margin-top">
  <hr>
  	<a href="http://mp.weixin.qq.com/s?__biz=MjM5NDQyOTYxNA==&mid=246067933&idx=1&sn=70875eb3cfa15e8a135bd071f95c6377#rd">
				<img src="${ctx}/img/mmexport.jpg" />
			</a>
  <p class="am-text-center">
    <small>by 全国交通网.</small>
  </p>
</footer>




	<!-- /.page-content -->
	<form  id="myform">
		<input type="hidden" name="type" id="type" value="${(type)!}">
		<input type="hidden" name="fromuser" id="fromuser" value="${(fromuser)!}">
		<#if (newlist)??> 
			<#list newlist as m> 
			<input type="hidden" name="id" id="id" value="${(m.id)!}">
			<input type="hidden" name="gkzt" id="gkzt" >
				</#list> 
				</#if>
	</form>
</body>


<!-- 以上页面内容 开发时删除 -->

<!--[if lt IE 9]>
<script src="http://libs.baidu.com/jquery/1.11.1/jquery.min.js"></script>
<script src="http://cdn.staticfile.org/modernizr/2.8.3/modernizr.js"></script>
<script src="${ctx}/css/assets/js/polyfill/rem.min.js"></script>
<script src="${ctx}/css/assets/js/polyfill/respond.min.js"></script>
<script src="${ctx}/css/assets/js/amazeui.legacy.js"></script>
<![endif]-->
<script src='${ctx}/static/jquery/1.8.3/jquery.js'
	type='text/javascript'></script>
<!--[if (gte IE 9)|!(IE)]><!-->
<script src="${ctx}/css/assets/js/amazeui.min.js"></script>
<!--<![endif]-->

<script src='${ctx}/static/easyui/1.3.2/jquery.easyui.min.js'
	type='text/javascript'></script>
<script>
	var imgUrl = '${(pic)!}';
	var lineLink = '${(url)!}wxContent/${(id)!}';
	var descContent = '${(descContent)!}';
	var shareTitle = '${(title)!}';
	var appid = '${(AppId)!}';

	function shareFriend() {
		WeixinJSBridge.invoke('sendAppMessage', {
			"appid" : appid,
			"img_url" : imgUrl,
			"img_width" : "640",
			"img_height" : "640",
			"link" : lineLink,
			"desc" : descContent,
			"title" : shareTitle
		}, function(res) {
			_report('send_msg', res.err_msg);
		})
	}
	function shareTimeline() {
		WeixinJSBridge.invoke('shareTimeline', {
			"img_url" : imgUrl,
			"img_width" : "640",
			"img_height" : "640",
			"link" : lineLink,
			"desc" : descContent,
			"title" : shareTitle
		}, function(res) {
			_report('timeline', res.err_msg);
		});
	}
	function shareWeibo() {
		WeixinJSBridge.invoke('shareWeibo', {
			"content" : descContent,
			"url" : lineLink,
		}, function(res) {
			_report('weibo', res.err_msg);
		});
	}
	// 当微信内置浏览器完成内部初始化后会触发WeixinJSBridgeReady事件。
	document.addEventListener('WeixinJSBridgeReady', function onBridgeReady() {

		// 发送给好友
		WeixinJSBridge.on('menu:share:appmessage', function(argv) {
			shareFriend();
		});

		// 分享到朋友圈
		WeixinJSBridge.on('menu:share:timeline', function(argv) {
			shareTimeline();
		});

		// 分享到微博
		WeixinJSBridge.on('menu:share:weibo', function(argv) {
			shareWeibo();
		});
	}, false);


	var argu = '${(argu)!}';
	<#if (gkzt)??> 
	<#if (gkzt)=="1">
		argu="edit";
	</#if>
	</#if>
	<#if (gkzt)??> 
	<#if (gkzt)=="0">
		argu="view";
	</#if>
	</#if>
	if (argu == "view") {
		function onBridgeReady() {
			WeixinJSBridge.call('hideOptionMenu');
		}

		if (typeof WeixinJSBridge == "undefined") {
			if (document.addEventListener) {
				document.addEventListener('WeixinJSBridgeReady', onBridgeReady,
						false);
			} else if (document.attachEvent) {
				document.attachEvent('WeixinJSBridgeReady', onBridgeReady);
				document.attachEvent('onWeixinJSBridgeReady', onBridgeReady);
			}
		} else {
			onBridgeReady();
		}
	}
	<#if (newlist)??> 
		 <#list mbtypelist as m>
		 $("#text${m_index+2}").prepend("${(m.mbsxmc)!}：");
		 </#list>
		</#if>
</script>
<script>

</script>
</@layout>
